<!DOCTYPE html>
<html>
<head>
<title>管理系统</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="stylesheet" type="text/css"
	href="/codebase/fonts/font_roboto/roboto.css" />
<link rel="stylesheet" type="text/css" href="/codebase/dhtmlx.css" />
<script type="text/javascript" src="/codebase/dhtmlxform.js"></script>
<style>
/* header */
div.my_header {
	padding-bottom: 1px;
}

div.my_header div.text_block {
	height: 50px;
	line-height: 44px;
	font-size: 28px;
	color: #199BC6;
	margin-left: 5px;
	padding-left: 200px;
	background-image: url("/common/szsrcb-logo.png");
	background-repeat: no-repeat;
	background-position: center left;
}

/*content*/
div.content {
	padding-left: 200px;
	font-size: 28px;
}
</style>
<script>
	/*<![CDATA[*/
	var myForm;

	function doOnLoad() {
		initForm();
		var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串
		var isOpera = userAgent.indexOf("Opera") > -1;
		if (userAgent.indexOf("compatible") > -1
				&& userAgent.indexOf("MSIE") > -1 && !isOpera) {
			//return "IE";
			alert("管理系统目前暂不支持IE，还请使用firefox或chrome浏览访问");
			/*    myForm.disableItem("login_submit");
			   myForm.disableItem("regrister"); */
		}
		; //判断是否IE浏览器
	}

	function initForm() {
		if (myForm) {
			myForm.unload();
			myForm = null;
		}
		/*
		var formData = [
			{type: "settings", position: "label-left", labelWidth: 100, inputWidth: 120,offsetLeft:200},
			
			{type: "label", name:"lable_login",label: "用户登录",offsetLeft:"150" },
			{type: "input", name:"login_name",label: "用户名", value: "",required:true},
			{type: "password", label: "密码", name:"pwd", value: "",required:true},
			//{type: "checkbox", name:"pwd",label: "Remember me", checked: true},
			{type:"button",name:"login_submit",value:"登录"}
		];
		 */
		//myForm = new dhtmlXForm("myForm", formData);
		myForm = new dhtmlXForm("myForm");
		myForm.loadStruct("/common/testmanager/login.xml");

		myForm.attachEvent("onButtonClick", function(name) {

			if (name == "login_submit") {
				this.send("/login", "post", callback);
			}
			if (name == "regrister") {
				window.location.pathname = "regrister";
			}
		});

		myForm.attachEvent("onKeyDown", function(inp, ev, name, value) {
			if (name == 'pwd' && ev.keyCode == 13) {
				this.send("/login", "post", callback);
			}

		});

	}

	function callback() {
		if (arguments[1] == "true") {
			window.location.pathname = "index";
		} else {
			alert(arguments[1]);
		}

	}
	/*]]>*/
</script>
</head>
<body onload="doOnLoad();">
	<!-- header -->
	<div id="my_logo" class="my_header">
		<div class="text_block">管理系统</div>
	</div>
	<table>
		<tr>
			<td>
				<div id="myForm" class="content"></div>
			</td>
		</tr>
			<tr>
			<td><a href="http://10.170.33.34/FirefoxSetup37.0.2_cn.exe">firefox安装程序下载链接</a>
				</td>
		</tr>
	</table>
</body>
</html>